//
//  GlobalData.m
//  ATAInterview
//
//  Created by up72-17 on 2018/12/12.
//  Copyright © 2018 up72-17. All rights reserved.
//

#import "GlobalData.h"

@implementation GlobalData

+ (instancetype)sharedGlobalData {
    static GlobalData *_globalData = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        //不能再使用alloc方法
        //因为已经重写了allocWithZone方法，所以这里要调用父类的分配空间的方法
        _globalData = [[super allocWithZone:NULL] init];
        //        _dbNetManager = [[self alloc] init];
        
    });
    return _globalData;
}

// 防止外部调用alloc 或者 new
+ (instancetype)allocWithZone:(struct _NSZone *)zone {
    return [GlobalData sharedGlobalData];
}


- (instancetype)init {
    self = [super init];
    if (self) {
        
    }
    return self;
}




@end
